<?php

namespace App\Observers;

use App\Caches\RoleCache;
use App\Models\Role;

class RoleObserver
{
    /**
     * @param Role $data
     */
    public function created(Role $data)
    {
        RoleCache::set($data->id);
    }

    /**
     * @param Role $data
     */
    public function updated(Role $data)
    {
        RoleCache::set($data->id);
    }

    /**
     * @param Role $data
     */
    public function deleted(Role $data)
    {
        RoleCache::del($data->id);
    }
}
